﻿package view.component
{
    import com.sh.game.display.*;
    import com.sh.game.global.*;
    import flash.display.*;
    import morn.core.components.*;
    import morn.core.handlers.*;

    public class LieHuoBuff extends Box
    {
        public var _data:Object;
        private var _bg:Image;
        private var _icon:Image;
        private var _effect:XMLMovieClip;
        public var _txt:Label;
        public static const effect2Xml:Class = LieHuoBuff_effect2Xml;

        public function LieHuoBuff()
        {
            this._icon = new Image();
            this._txt = new Label();
            this._txt.y = 48;
            this._txt.width = 45;
            this._txt.color = "0x31cf08";
            this._txt.stroke = "0x0";
            this._txt.align = "center";
            this.addChild(this._icon);
            this.addChild(this._txt);
            App.mloader3.loadSWF(Config.getUrl("assets/images/mainui/autoskill.swf"), 3, new Handler(this.loadAutoSkill));
            return;
        }// end function

        private function loadAutoSkill(param1) : void
        {
            var _loc_2:XML = null;
            if (!this._effect)
            {
                _loc_2 = new XML(new effect2Xml());
                this._effect = new XMLMovieClip("png.movie.autoskill", _loc_2);
            }
            if (!this._effect.parent)
            {
                this._effect.interval = 100;
                this._effect.x = -76;
                this._effect.y = -77;
                this._effect.play();
                this._effect.blendMode = BlendMode.ADD;
                this._effect.mouseEnabled = false;
                addChild(this._effect);
            }
            return;
        }// end function

        public function set data(param1:Object) : void
        {
            this._data = param1;
            this._icon.url = Config.getUrl("assets/images/icon/buffer/" + this._data.cfg.icon + ".jpg");
            var _loc_2:int = 45;
            this._icon.height = 45;
            this._icon.width = _loc_2;
            return;
        }// end function

        public function dispose() : void
        {
            if (this.parent)
            {
                this.parent.removeChild(this);
            }
            if (this._bg)
            {
                if (this._bg.parent)
                {
                    this._bg.parent.removeChild(this._bg);
                }
                this._bg = null;
            }
            if (this._icon)
            {
                if (this._icon.parent)
                {
                    this._icon.parent.removeChild(this._icon);
                }
                this._icon = null;
            }
            if (this._effect)
            {
                if (this._effect.parent)
                {
                    this._effect.parent.removeChild(this._effect);
                }
                this._effect.dispose();
                this._effect = null;
            }
            this._data = null;
            return;
        }// end function

    }
}
